package ${packageServiceImpl};

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.tdcy.sys.service.ISeqNoSvc;
import com.tdcy.framework.util.BeanUtil;
import com.tdcy.framework.util.JsonUtils;
import com.tdcy.framework.util.RequestUtils;
import ${packageDAO}.I${tableJavaClassName}DAO;
import ${packageEO}.${tableJavaClassName}EO;
import ${packageService}.I${tableJavaClassName}Svc;
import ${packageBean}.${tableJavaClassName}QueryCondition;
import com.tdcy.framework.bean.PageInfo;

/**
* @Description ${tableComments}Service实现类
*/
@Service
public class ${tableJavaClassName}SvcImpl implements I${tableJavaClassName}Svc {

	@Resource
	I${tableJavaClassName}DAO ${tableName}DAO;

	@Resource
	ISeqNoSvc seqSvc;

	public List<${tableJavaClassName}EO> getAll${tableJavaClassName}() {
		return ${tableName}DAO.findTableRecords(${tableJavaClassName}EO.class);
	}
	
	@Override
	public ${tableJavaClassName}EO get${tableJavaClassName}Info(Integer ${tableName}Id) {
		return ${tableName}DAO.findByPrimaryKey(${tableJavaClassName}EO.class, ${tableName}Id);
	}

	@Override
	public ${tableJavaClassName}EO update${tableJavaClassName}(${tableJavaClassName}EO ${tableName}) {
		${tableJavaClassName}EO ${tableName}eo=${tableName}DAO.update(${tableName});
		return ${tableName}eo;
	}

	@Override
	public ${tableJavaClassName}EO add${tableJavaClassName}(${tableJavaClassName}EO ${tableName}) {
		${tableName}.set${pkFieldMethod}(seqSvc.getMaxNo("${tablePKName}"));
		${tableJavaClassName}EO ${tableName}eo=${tableName}DAO.save(${tableName});
		return ${tableName}eo;
	}

	@Override
	public boolean del${tableJavaClassName}(Integer ${tableName}id) {
		return ${tableName}DAO.deleteByPrimaryKey(${tableJavaClassName}EO.class, ${tableName}id);
	}
}
